For the q1, the algorithm used is as follows:
- Select points on the image, to create set of parallel lines
- Project these points into projective space, by appending 1 at the end of each
- Generate lines by using the formula $ L = \overrightarrow{p1} \times \overrightarrow{p2} $
- Generate point at infinty using the parallel lines, as $p_{1inf} = \overrightarrow{L1}\times\overrightarrow{L2}$, similarly for $p_{2inf}$
- Generate line at infinty as, $l_{inf} = \overrightarrow{p_{1inf}} \times \overrightarrow{p_{2inf}}$
- As for affine rectification, the homography matrix is, $H = \begin{bmatrix}1&0&0\\0&1&0\\l_1&l_2&1\end{bmatrix} $, we solve the equation of $H^{-T}l_{inf} = \begin{bmatrix}0\\0\\1\end{bmatrix}$
- This leads to a solution of $l_1 = a_2 , l_2 = a_1$, where $l_{inf} = \begin{bmatrix}a_1\\a_2\\1\end{bmatrix}$